package org.car.world.service.impl;

import java.util.List;

import org.car.world.core.entily.PictureTable;
import org.car.world.core.mapper.PictureTableMapper;
import org.car.world.service.PictureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;

@Service
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class PictureServiceImpl implements PictureService {

    @Autowired
    PictureTableMapper pictureTableMapper;

    @Override
    public int deleteByPrimaryKey(Integer informationId) {
        return pictureTableMapper.deleteByPrimaryKey(informationId);
    }

    @Override
    public int insert(PictureTable record) {
        return pictureTableMapper.insert(record);
    }

    @Override
    public PictureTable selectByPrimaryKey(Integer informationId) {
        return pictureTableMapper.selectByPrimaryKey(informationId);
    }

    @Override
    public List<PictureTable> selectAll() {
        return pictureTableMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKey(PictureTable record) {
        return pictureTableMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<PictureTable> selectType(Integer pictype) {
        return pictureTableMapper.selectType(pictype);
    }

    @Override
    public int count(Integer pictype) {
        return pictureTableMapper.count(pictype);
    }

    @Override
    public List<PictureTable> selectLimit(Integer form, Integer size, Integer pictype) {
        PageHelper.startPage(form, size);
        return pictureTableMapper.selectType(pictype);
    }

    @Override
    public int updatePic(Integer picid) {
        return pictureTableMapper.updatePic(picid);
    }

}
